$(function () {
        var mySwiper = new Swiper('.swiper-container', {
            onSlideChangeEnd: function (swiper) {
            	
                var j = mySwiper.activeIndex;  
             
                $('.maple-tab li').removeClass('active').eq(j).addClass('active');
                $('.maple-tab li a').removeClass('a').eq(j).addClass('a');
                var content_height = $(".content_div").eq(j).height();
                var slide_height = $(".swiper-slide").eq(j).height(content_height);
                $(".swiper-wrapper").css("height", content_height);
                $(".swiper-container").css("height", content_height);
            }
        })


        /*列表切换*/
        $('.maple-tab li').on('click', function (e) {
            e.preventDefault();
            //得到当前索引
            var i = $(this).index();
            $('.maple-tab li').removeClass('active').eq(i).addClass('active');
            $('.maple-tab li a').removeClass('a')
				if ( i==1 ) {
					//alert(1)
					$('.maple-tab li:nth-of-type(2) img').attr("src","images/product/bannerBDP_04.png")
					$('.maple-tab li a').removeClass('a');
					$('.maple-tab li:nth-of-type(2) a').addClass('a');
					$('.maple-tab li:nth-of-type(3) img').attr("src","images/product/bannerBDP_06.png")
					$('.maple-tab li:nth-of-type(4) img').attr("src","images/product/bannerBDP_08.png")
					$('.maple-tab li:nth-of-type(5) img').attr("src","images/product/bannerBDP_10.png");
					$('.maple-tab li:nth-of-type(6) img').attr("src","images/product/bannerIDP_03.png");
					$('.maple-tab li:nth-of-type(7) img').attr("src","images/product/bannerMBI_05.png");					
				}else if (i==2) {
					$('.maple-tab li:nth-of-type(2) img').attr("src","images/product/bannerIXP_03.png")
					$('.maple-tab li:nth-of-type(4) img').attr("src","images/product/bannerBDP_08.png")
					$('.maple-tab li:nth-of-type(5) img').attr("src","images/product/bannerBDP_10.png");
					$('.maple-tab li:nth-of-type(6) img').attr("src","images/product/bannerIDP_03.png");
					$('.maple-tab li:nth-of-type(7) img').attr("src","images/product/bannerMBI_05.png");	
					$('.maple-tab li:nth-of-type(3) a').addClass('a');
					$('.maple-tab li:nth-of-type(3) img').attr("src","images/product/bannerMBI_03.png")
				}
				else if (i==3) {
					$('.maple-tab li:nth-of-type(3) img').attr("src","images/product/bannerBDP_06.png")					
					$('.maple-tab li:nth-of-type(2) img').attr("src","images/product/bannerIXP_03.png")
					$('.maple-tab li:nth-of-type(5) img').attr("src","images/product/bannerBDP_10.png");
					$('.maple-tab li:nth-of-type(6) img').attr("src","images/product/bannerIDP_03.png");
					$('.maple-tab li:nth-of-type(7) img').attr("src","images/product/bannerMBI_05.png");	
					$('.maple-tab li:nth-of-type(4) a').addClass('a');	
					$('.maple-tab li:nth-of-type(4) img').attr("src","images/product/bannerBPM_03.png")
				}
				else if (i==4) {
					$('.maple-tab li:nth-of-type(3) img').attr("src","images/product/bannerBDP_06.png")					
					$('.maple-tab li:nth-of-type(2) img').attr("src","images/product/bannerIXP_03.png")
					$('.maple-tab li:nth-of-type(4) img').attr("src","images/product/bannerBDP_08.png")
					$('.maple-tab li:nth-of-type(6) img').attr("src","images/product/bannerIDP_03.png");
					$('.maple-tab li:nth-of-type(7) img').attr("src","images/product/bannerMBI_05.png");	
					$('.maple-tab li:nth-of-type(5) a').addClass('a');
					$('.maple-tab li:nth-of-type(5) img').attr("src","images/product/bannerIXP_03-02.png")
				}
				else if (i==5) {
					 $('.maple-tab li:nth-of-type(3) img').attr("src","images/product/bannerBDP_06.png")					
					$('.maple-tab li:nth-of-type(2) img').attr("src","images/product/bannerIXP_03.png")
					$('.maple-tab li:nth-of-type(4) img').attr("src","images/product/bannerBDP_08.png")
					$('.maple-tab li:nth-of-type(5) img').attr("src","images/product/bannerBDP_10.png");
					$('.maple-tab li:nth-of-type(7) img').attr("src","images/product/bannerMBI_05.png");	
					$('.maple-tab li:nth-of-type(6) a').addClass('a');
					$('.maple-tab li:nth-of-type(6) img').attr("src","images/product/bannerDAP_03.png")
				}
				else if (i==6) {
					$('.maple-tab li:nth-of-type(3) img').attr("src","images/product/bannerBDP_06.png")					
					$('.maple-tab li:nth-of-type(2) img').attr("src","images/product/bannerIXP_03.png")
					$('.maple-tab li:nth-of-type(4) img').attr("src","images/product/bannerBDP_08.png")
					$('.maple-tab li:nth-of-type(5) img').attr("src","images/product/bannerBDP_10.png");
					$('.maple-tab li:nth-of-type(6) img').attr("src","images/product/bannerIDP_03.png");
					$('.maple-tab li:nth-of-type(7) a').addClass('a');
					$('.maple-tab li:nth-of-type(7) img').attr("src","images/product/bannerIDP_05.png")
				}

            var content_height = $(".content_div").eq(i).height();
            var slide_height = $(".swiper-slide").eq(i).height(content_height);
            $(".swiper-wrapper").css("height", content_height);
            $(".swiper-container").css("height", content_height);
          
            mySwiper.slideTo(i, 1000, false);

        });
    });
   